package com.wcy.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.wcy.annotation.pageVo.PageColumn;
import com.wcy.annotation.pageVo.PageName;
import lombok.*;
import lombok.experimental.Accessors;

import java.util.Objects;

/**
 * <p>
 * 
 * </p>
 *
 * @author 吴传亿
 * @since 2025-04-29
 */
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
@ToString
@Accessors(chain = true)
@PageName(name = "权限")
public class Permission {

    @PageColumn(isId = true,prop="permissionId", label="权限ID",allowEdit = false)
    @TableId(value = "permission_id", type = IdType.AUTO)
    private Integer permissionId;

    @PageColumn(prop="permissionName", label="权限名")
    private String permissionName;

    @PageColumn(prop="description", label="权限描述")
    private String description;

    //用于快速载入数据
    public Permission(Integer permissionId){
        this.permissionId = permissionId;
    }

    public int hashCode() {
        return permissionId;
    }
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        Permission other = (Permission) obj;
        return Objects.equals(permissionId, other.permissionId);
    }
}
